#include <exp_main.h> cc files... -lexptcl -ltcl
Briefly, this library allows C programs to provide Expect commands along with Tcl and Tk commands. See the Tk documentation on how to integrate Tk with a C program (the wish program is a good example). To add the Expect calls, add include the file "exp_main.h" and a call to exp_init(interp), where interp has been defined from Tcl_CreateInterp().
The expectk program is an example of this.
Design and implementation of the expect library was paid for by the U.S. government and is therefore in the public domain. However the author and NIST would like credit if this program and documentation or portions of them are used.